// Copyright (c) 2002 HTHK
//******************************************************************/
//Modification History
//******************************************************************/
//CR log no 1266: By Ploy Li on 2004-04-27
//******************************************************************/

package com.system.userMultiRole;

import com.ffpc.sql.*;

public class UserMultiRole
   extends DataObject
   implements UserMultiRoleBean
{
   private String user_id = null;
   private String role_id = null;
   private String crt_user = null;
   private String crt_date = null;
   private String upd_user = null;
   private String upd_date = null;
   private Column ColUserId = null;
   private Column ColRoleId = null;
   private Column ColCrtUser = null;
   private Column ColCrtDate = null;
   private Column ColUpdUser = null;
   private Column ColUpdDate = null;
   /**
    * Constructor
    */
   public UserMultiRole()
   {
       ColUserId = new Column(0,"user_id",Column.Types.string,null,10,false);
       ColRoleId = new Column(1,"role_id",Column.Types.string,null,10,false);
       ColCrtUser = new Column(2,"crt_user",Column.Types.string,null,10,true);
       ColCrtDate = new Column(3,"crt_date",Column.Types.time,null,7,false);
       ColUpdUser = new Column(4,"upd_user",Column.Types.string,null,10,true);
       ColUpdDate = new Column(5,"upd_date",Column.Types.time,null,7,false);
   }

   // functions belongs to UserBean interface

   @Override
public void setUser_id(String user_id)
   {       this.user_id = this.setAttribute(ColUserId,user_id);
   }

   @Override
public String getUser_id()
   {       return this.user_id==null?"":this.user_id;
   }

   @Override
public void setRole_id(String role_id)
   {       this.role_id = this.setAttribute(ColRoleId,role_id);
   }

   @Override
public String getRole_id()
   {       return this.role_id==null?"":this.role_id;
   }

   @Override
public void setCrt_user(String crt_user)
   {       this.crt_user = this.setAttribute(ColCrtUser,crt_user);
   }

   @Override
public String getCrt_user()
   {       return this.crt_user==null?"":this.crt_user;
   }

   @Override
public void setCrt_date(String crt_date)
   {       this.crt_date = this.setAttribute(ColCrtDate,crt_date);
   }

   @Override
public String getCrt_date()
   {       return this.crt_date==null?"":this.crt_date;
   }

   @Override
public void setUpd_user(String upd_user)
   {       this.upd_user = this.setAttribute(ColUpdUser,upd_user);
   }

   @Override
public String getUpd_user()
   {       return this.upd_user==null?"":this.upd_user;
   }

   @Override
public void setUpd_date(String upd_date)
   {       this.upd_date = this.setAttribute(ColUpdDate,upd_date);
   }

   @Override
public String getUpd_date()
   {       return this.upd_date==null?"":this.upd_date;
   }

   // belongs to row interface

   @Override
public Column[] createColumns()
   {
       Column[] cols = new Column[6];
       cols[0] = ColUserId.clone(null);
       cols[1] = ColRoleId.clone(null);
       cols[2] = ColCrtUser.clone(null);
       cols[3] = ColCrtDate.clone(null);
       cols[4] = ColUpdUser.clone(null);
       cols[5] = ColUpdDate.clone(null);
       return cols;
   }

   // super's abstract methods

   @Override
public String getTableName()
   {
       return "jis.jis_s_user_role";
   }

   @Override
protected String[] getKeyColumnNames()
   {
       String[] list = {
                         "user_id"
                         ,"role_id"
                       };
       return list;
   }

   @Override
protected String[] getUpdatableColumnNames()
   {
       String[] list = {
                         "crt_user"
                         ,"crt_date"
                         ,"upd_user"
                         ,"upd_date"
                       };
       return list;
   }

   @Override
protected void retrieveColumnValues()
   {
       this.user_id = this.retrieveColumnValue("user_id");
       this.role_id = this.retrieveColumnValue("role_id");
       this.crt_user = this.retrieveColumnValue("crt_user");
       this.crt_date = this.retrieveColumnValue("crt_date");
       this.upd_user = this.retrieveColumnValue("upd_user");
       this.upd_date = this.retrieveColumnValue("upd_date");
   }
}

